package com.nCoV.EpidemicSurveillance.controller;

import org.apache.commons.lang3.RandomUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nCoV.EpidemicSurveillance.domain.DemoNode;
import com.nCoV.EpidemicSurveillance.service.DemoService;

/**
 * @author 罗穆健
 * @date 2020年3月3日
 */
@Controller
public class demo {

	@Autowired
	DemoService demoService;
	
	
	@RequestMapping(path = "/addUserNode", method = RequestMethod.GET)
	@ResponseBody
    public String addUserNode() {
		System.out.println(1);
        int i = 0;
        do {
            DemoNode user = new DemoNode();
            user.setName("luomujian" + RandomUtils.nextInt(1, 1000));
            demoService.addUser(user);
            i += 1;
        } while (i < 5);

        return "ok";
    }
}
